package com.boarsoft.flow.demo.query;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.boarsoft.common.util.JsonUtil;
import com.boarsoft.flow.core.bean.WrapHandler;
import com.boarsoft.flow.demo.bean.User;

public class UserIdWrapHandlerImpl implements WrapHandler {
	private static final Logger log = LoggerFactory.getLogger(UserIdWrapHandlerImpl.class);

	@Override
	public Object checkIn(String entry, Object currData) {
		User u = (User) currData;
		return u.getId();
	}

	@Override
	public Object checkOut(Object nodeData, Object currData) {
		// Map<String, Object> rm = new HashMap<String, Object>();
		// rm.put("user", currData);
		// rm.put("money", nodeData);
//		log.info("nodeData = {}", nodeData);
//		log.info("currData = {}", JsonUtil.from(currData));
		return currData;
	}
}
